package com.yl.auth.service.impl;

import com.yl.auth.model.entity.Bumen;
import com.yl.auth.mapper.BumenMapper;
import com.yl.auth.model.vo.BumenVo;
import com.yl.auth.service.BumenService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author
 * @since 2023-06-15
 */
@Service
public class BumenServiceImpl extends ServiceImpl<BumenMapper, Bumen> implements BumenService {

    @Resource
    private BumenMapper bumenMapper;

    @Override
    public void addChilren(Bumen bumen,Integer id) {
       if(bumen!=null){
           Bumen bumen1 = bumenMapper.selectById(id);
           if(bumen1!=null){
               bumen.setPid(bumen1.getId());
               bumenMapper.addChilren(bumen);
           }
       }
    }
}
